package com.construction_Safety.leave.domain;

import java.util.Date;
import javax.validation.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.construction_Safety.common.annotation.Excel;
import com.construction_Safety.common.core.domain.BaseEntity;

/**
 * 请假信息管理对象 c_leave
 * 
 * @author yat
 * @date 2025-11-10
 */
public class CLeave extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 编号 */
    private Long id;

    /** 请假时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "请假时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date leaveTime;

    /** 销假时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "销假时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date backTime;

    /** 请假类型（字典：leave_type） */
    @Excel(name = "请假类型")
    private Integer type;

    /** 申请表状态 */
    @Excel(name = "申请表状态")
    private Long status;

    /** 请假原因 */
    @Excel(name = "请假原因")
    private String reason;

    private CLeaveUser cLeaveUser;

    public CLeaveUser getcLeaveUser() {
        return cLeaveUser;
    }

    public void setcLeaveUser(CLeaveUser cLeaveUser) {
        this.cLeaveUser = cLeaveUser;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setLeaveTime(Date leaveTime) 
    {
        this.leaveTime = leaveTime;
    }

    public Date getLeaveTime() 
    {
        return leaveTime;
    }

    public void setBackTime(Date backTime) 
    {
        this.backTime = backTime;
    }

    public Date getBackTime() 
    {
        return backTime;
    }

    public Integer getType()
    {
        return type;
    }

    public void setType(Integer type)
    {
        this.type = type;
    }

    public void setStatus(Long status) 
    {
        this.status = status;
    }

    public Long getStatus() 
    {
        return status;
    }

    public void setReason(String reason) 
    {
        this.reason = reason;
    }

    @NotBlank(message = "请假原因不能为空")
    public String getReason() 
    {
        return reason;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("leaveTime", getLeaveTime())
            .append("backTime", getBackTime())
            .append("type", getType())
            .append("status", getStatus())
            .append("reason", getReason())
            .append("cLeaveUser", getcLeaveUser())
            .toString();
    }
}
